{% extends 'umessages/base_message.html' %}
{% load i18n %}
{% load djangohelper_tags %}

{% block content_title %}
  {% get_setting "SYSTEM_USER_ID" 0 "SYSTEM_USER_ID" %}
  <h2>
    {% if recipient.pk == SYSTEM_USER_ID %}
      <span class="sysuser"> 系统消息 </span>
    {% else %}
      与 {{ recipient }} 的消息记录
    {% endif %}
  </h2>
{% endblock %}

{% block sidebar %}
  {% get_setting "SYSTEM_USER_ID" 0 "SYSTEM_USER_ID" %}
  <div class="sidebar">
    <div style="padding-top: 20px;">
      {% if recipient.pk != SYSTEM_USER_ID %}
      <a href="{% url userena_umessages_compose_to recipient.username %}" class="btn">
        <i class="icon-share-alt"></i>
        回复
      </a>
      {% endif %}
    </div>
  </div>
{% endblock %}

{% block content %}
  <div class="content">
    <ul id="messages">
      {% for message in message_list %}
        <li class="{% if message.sender == user %}send{% else %}received{% endif %}">
          <img src="{{ message.sender.profile.get_mugshot_url }}" class="avatar thumbnail {% if message.sender == user %}send{% else %}received{% endif %}" />
          <div class="message-content">
            {{ message }}
            <p class="date">{{ message.sent_at }}</p>
          </div>
        </li>
      {% endfor %}
    </ul>
  </div>
{% endblock %}
